package com.neutech.service.impl;
import com.neutech.mapper.PtestMapper;
import com.neutech.service.PtestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PtestServiceImpl implements PtestService {
    @Autowired
    private PtestMapper ptestMapper;

    @Override
    public List<Map<String, Object>> queryPtestByName(String name) {
        return ptestMapper.queryPtestByName(name);
    }
    @Override
    public List<Map<String,Object>>queryTestByName(String name) {
    return ptestMapper.queryTestByName(name);
}
    @Override
    public void addPtest(Map<String, Object> map) {

        for (Object key : map.keySet()) {
            Object  value = map.get(key);
            map.put((String) key,value);
        }
        map.put("room","检验科");
        map.put("state","已预约");
        ptestMapper.addPtest(map);
    }

    @Override
    public void delptest(Integer num) {
        ptestMapper.delptestBynum(num);
    }

    @Override
    public List<Map<String, Object>> queryPtestByIdnumber(Integer idnumber) {
      return ptestMapper.queryPtestByIdnumber(idnumber);
    }
}
